//
//  Doctor.m
//  OC02_作业
//
//  Created by dllo on 15/12/1.
//  Copyright © 2015年 dllo. All rights reserved.
//

#import "Doctor.h"

@implementation Doctor

- (void)sayHello{
    NSLog(@"hello!");
}
- (void)information{
    NSLog(@"name:%@, age:%d", _name, _age);
}

//- (void)setName:(NSString *)name {
//    _name = name;
//}
//- (NSString *)name {
//    return _name;
//}
//
//- (void)setAge:(int)age {
//    _age = age;
//}
//- (int)age {
//    return _age;
//}

- (instancetype)initWithName:(NSString *)name
                         age:(int)age {
    self = [super init];
    if (self) {
        _name = name;
        _age = age;
    }
    return self;
}

+ (instancetype)doctorWithName:(NSString *)name
                           age:(int)age {
    Doctor *doctor = [[Doctor alloc] initWithName:name age:age];
    return doctor;
    
}



@end
